home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fritz: All Fritz
/
All Fritz.zip
/
All Fritz
/
FILES
/
PROGASIC
/
BASFILES.LZH
/
QBTXOPEN.BAS
< prev
next >
Wrap
BASIC Source File
|
1988-09-10
|
1KB
|
45 lines
'$INCLUDE:'QBTOOLS.INC'
'' '$INCLUDE: 'qbtools2.inc'
'' '$INCLUDE: 'qbt2indx.inc'
'' '-------------------------Standard Include Merge Section-------------------
DEFSNG A-Z
SUB IndexOpen (IxNum%, hn$, Xnm$(), Xk$(), Xh%()) STATIC
' open the header, read info and close the header
aesbfatal% = 0
IF IxNum% > 20 OR IxNum% < 1 OR IxNum% > UBOUND(Xh%, 1) OR IxNum% < LBOUND(Xh%, 1) THEN
aesbfatal% = 1
ELSE
Xnm$(IxNum%) = hn$
OPEN "r", IxNum%, hn$ + ".hdr", 512
FIELD #IxNum%, 32 AS desc$, 32 AS xmast$, 2 AS klen$, 2 AS nok$, 2 AS nexav$
FIELD #IxNum%, 70 AS twit$, 2 AS kdel$, 440 AS spare$
GET #IxNum%, 1
'mfile$=xmast$ <--- dont take name from from .HDR
Xh%(IxNum%, 1) = CVI(klen$)
Xh%(IxNum%, 2) = CVI(nok$)
Xh%(IxNum%, 3) = CVI(nexav$)
Xh%(IxNum%, 4) = CVI(kdel$)
CLOSE IxNum%
' Next line modified to open index file from path\name passed in
mfile$ = hn$ + ".idx" 'Line added to use FILES=
OPEN "r", IxNum%, mfile$, Xh%(IxNum%, 1) + 10
FIELD #IxNum%, Xh%(IxNum%, 1) AS Xk$(IxNum%, 1), 2 AS Xk$(IxNum%, 2), 2 AS Xk$(IxNum%, 3)
FIELD #IxNum%, Xh%(IxNum%, 1) + 4 AS twit$, 2 AS Xk$(IxNum%, 4), 2 AS Xk$(IxNum%, 5), 2 AS Xk$(IxNum%, 6)
LSET Xk$(IxNum%, 1) = STRING$(Xh%(IxNum%, 1), 0)
FOR init% = 2 TO 6
LSET Xk$(IxNum%, init%) = MKI$(0)
NEXT init%
PUT #IxNum%, Xh%(IxNum%, 3)
END IF
END SUB